home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97b.txt / 000124_icon-group-sender _Mon Nov 24 08:30:50 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA20025
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 24 Nov 1997 08:30:49 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA07618; Mon, 24 Nov 1997 08:30:49 -0700
  7. From: Mike D Cross <crossmd@mh.uk.sbphrd.com>
  8. Message-Id: <199711221443.OAA03592@heu534.ha.uk.sbphrd.com>
  9. X-Authentication-Warning: heu534.ha.uk.sbphrd.com: localhost [127.0.0.1] didn't use HELO protocol
  10. To: icon-group@optima.CS.Arizona.EDU
  11. Cc: crossmd@mh.uk.sbphrd.com
  12. Subject: Question - How to extract data from a formatted line.
  13. Date: Sat, 22 Nov 97 14:43:22 +0000
  14. X-Mts: smtp
  15. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  16. Status: RO
  17.  
  18. Hi,
  19.  
  20. I've been given some Perl programs which extract data from lines
  21. of text, each line being of a set format. In perl you do:
  22.  
  23. @dumpline = /^RLOGNAME=\"(.*)\" UID=\"(.*)\" GID=\"(.*)\" PROFILE=\"(.*)\" 
  24. REALNAME=\"(.*)\" HOMEDIR=\"(.*)\" USERLASTCHANGE=\"(.*)\" FLAGS=\"(.*)\" 
  25. PSW=\"(.*)\" PSWLASTCHANGE=\"(.*)\" NO_PWDF=\"(.*)\" SERIAL=\"(.*)\" 
  26. PSWKEY=\"(.*)\" LASTTTY=\"(.*)\" LASTLOGIN=\"(.*)\" LASTLOGOUT=\"(.*)\" 
  27. RETRY=\"(.*)\" RESERVED1=\"(.*)\" RESERVED2=\"(.*)\" LOGINVALIDTIME=\"(.*)\" 
  28. PSWVALIDTIME=\"(.*)\" CHPSWTIME=\"(.*)\" PSWMINLEN=\"(.*)\" PSWFORCE=\"(.*)\" 
  29. PSWHISTLEN=\"(.*)\" CHPSWFREQ=\"(.*)\" TIMEOUT=\"(.*)\" TTIMEOUT=\"(.*)\" 
  30. TDAYS=\"(.*)\" TSTART=\"(.*)\" TEND=\"(.*)\" RETRYMAX=\"(.*)\" 
  31. CONCUR_LOGINS=\"(.*)\" SHELL=\"(.*)\" PARAMETERMASK=\"(.*)\".*$/;
  32.  
  33. which generates an array (dumpline) which contains all the text 
  34. which matched the pattern \"(.*)\"
  35.  
  36. The input file contains about 20 different format lines, I'm 
  37. not a fan of Perl and would like to re-write the programs in
  38. Icon,  but I need some hints on the best method.
  39.  
  40. Thanks in advance
  41.  
  42. Mike
  43.  
  44. =============================================================
  45. Mike Cross
  46. Principal Analyst
  47. UNIX Systems
  48. SmithKline Beecham                 
  49. New Frontiers Science Park (South) 
  50. Third Avenue, Harlow,
  51. CM19 5AW                           email:  crossmd@mh.uk.sbphrd.com
  52.